<?php

namespace App\Events;

use App\Constant\NewFlowEnum;
use App\Models\UserLoanRequest;
use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class NewFlowOrderEvent
{
    use Dispatchable, InteractsWithSockets, SerializesModels;


    public $enum;

    public $loan;

    public $loan_id;

    public $data;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct($enum, $loan = false, $loan_id = 0, $data = [])
    {
        $this->enum = $enum;
        $this->loan = $loan;
        $this->loan_id = $loan_id;
        $this->data = $data;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}
